//
//  HWParagraphString.h
//  ParagraphString
//
//  Created by Lucy_Lee on 2017/1/18.
//  Copyright © 2017年 Lucy_Lee. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface HWParagraphString : NSObject

/**
 Input string
 */
@property (nonatomic, copy) NSString * string;


/**
 set input string's font default is 0
 */
@property (nonatomic, strong) UIFont * font;


/**
 set input string's text color default nil
 */
@property (nonatomic, strong) UIColor * textColor;


/**
 set the paragraph style
 */
@property (nonatomic, strong) NSMutableParagraphStyle * paragraphStyle;


/**
 make the config effective (font textcolor paragraph)
 */
- (void)makeConfigEffective;


/**
 you should make config first when you get attributeString
 */
@property (nonatomic, strong, readonly) NSMutableAttributedString * attributedString;


/**
 he string's height with the fixed width.

 @param width the specified width
 @return string's height
 */
- (CGFloat)heightWithFixedWidth:(CGFloat)width;


/**
 string's height with the fixed width

 @param lines number 0f lines
 @param width specified width
 @return string's height
 */
- (CGFloat)numberOfLines:(NSInteger)lines fixedWidth:(CGFloat)width;

/**
 paragraphString's constructor

 @param string string
 @param font font
 @param color color
 @param style paragraph style
 @return paragraph's instace
 */
+ (instancetype)paragraphStringWithString:(NSString *)string
                                     font:(UIFont *)font
                                    color:(UIColor *)color
                           paragraphStyle:(NSMutableParagraphStyle *)style;


@end
